# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo10
# Description:
# Author:       98745
# Date:         2019/3/10
#-------------------------------------------------------------------------------

from pymysql import *
import json
def connectdb():
    db=connect("127.0.0.1","root","root","xuexi",charset="utf8")
    return db
db=connectdb()
def select(db):
    cursor=db.cursor()
    sql='select * from xs'
    cursor.execute(sql)
    r=cursor.fetchall()
    print(r)
if __name__ =='__main__':
    select(db)